Add workflow to update local member data on pull request #27
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the
update-new-members.yml
workflow. This workflow will run on pull requests targeting themain
branch. I think it should run on every commit, we should test this.This workflow starts out by running
bin/update-new-members
. This is a script that will figure out what inmembers.csv
changed between the current branch and themain
branch. If there are new lines in that file,bin/update-member
will be run for each line. This script compares the remote JSON file and the local JSON file (if it exists), and checks which one is more recent using thedatetimeModified
field. If the remote JSON file is more recent, it is saved in place of the old local JSON file. This change is then automatically committed to the PR's branch.bin/update-member
checks for existing files because it can be used not only to fetch new members, but also to update the data of existing members. I've included abin/update-all-members
script, which will loop through every line inmembers.csv
, and attempt to fetch any updates. Right now, this script is not run, but we can find a way to schedule it.Note that, when a member is removed, both the entry in
members.csv
and the.json
file needs to be removed by the committer.I've changed
members.csv
to have some test URLs so that we can actually see these scripts running.I've removed the
urlSource
field in the schema, but let me know if this doesn't make sense. My reasoning is that the single source of truth for the URLs is inmembers.csv
. If we fetch the JSON file, the JSON file doesn't need to tell us where it is — we know where it is because we already fetched it.As far as I can tell, if this is merged there are two main other things to do:
README.md